import { useEffect } from 'react';
import { useLocation } from 'umi';

export default function index() {
  const location = useLocation();
  console.log(location);
  const search = new URLSearchParams(location.search).get('search');
  const hash = new URLSearchParams(location.hash.slice(1)).get('hash');
  useEffect(() => {
    fetch('./list.json')
      .then((data) => data.json)
      .then((res) => console.log(res))
      .catch((error) => Promise.reject(error));
  }, []);
  return (
    <>
      <div>search:{search}</div>
      <div>hash:{hash}</div>
    </>
  );
}
